-
Notifications
You must be signed in to change notification settings - Fork 27
✨ Add file
provider for kubeconfig on the filesystem
#53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Welcome @ntnn! |
file
provider for kubeconfig on the filesystemfile
provider for kubeconfig on the filesystem
3e22a25
to
89dc416
Compare
|
@ntnn very cool provider! I know its a bit late for this idea (a lot of work has went into this PR!), but what if you added this functionality to the existing kubeconfig provider? Was thinking about maybe changing the kubeconfig provider options to use functions instead of config struct, then could be something like: p, err := kubeconfig.New(
kubeconfig.WithFileWatcher(fileWatchConfigs...),
kubeconfig.WithSecretWatcher(secretWatchConfigs...)
) What do you all think of that? |
Hi @FourFifthsCode ! Thanks! Imho most overlap is how to engange/disengage clusters and that is common between all providers. Personally I was hoping to keep providers simpler and to instead use a "meta" provider to use multiple providers. If a provider accepts multiple different sources the same problem arises and the clusterName would either have to be prefixed or just logging an error - which is what I currently do here in the file provider, but the file provider is only meant to make it possible to inject some kubeconfigs when working on a controller. I think a library with a generic provider that handles the common management of engaging/disengaging clusters would be great to simplify writing further providers. |
@ntnn yeah, I think what you said makes a lot of sense! Multi-provider and some more shared code sounds great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
🎉
LGTM label has been added. Git tree hash: f439f19e5a7fe22505f0b026f1e52f7c1a0fe4b9
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: embik, ntnn The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adds a provider for kubeconfigs on the filesystem.
The name is a bit nondescript, but
kubeconfig
is already used by the provider reading kubeconfigs from secrets.multicluster-runtime currently does not come with a way to pass or set a kubeconfig file for testing and this would fit that bill.